import Vue from 'vue'
import vueRouter from 'vue-router'
 Vue.use(vueRouter)
 const router = new vueRouter({
     routes:[
        {
            path: '/',
            redirect: '/login'
        },
         {
             path:'/',
             component: resolve => require(['../../components/pages/home.vue'], resolve),
             children:[
                {
                    path: '/index',
                    component: resolve => require(['../../components/pages/index.vue'], resolve),
                    meta: { title: '首页',requireAuth:true }
                    
                },
                {
                    path: '/parkInfo',
                    component: resolve => require(['../../components/pages/parkInfo.vue'], resolve),
                    meta: { title: '车位信息',requireAuth:true }
                    
                },
                {
                    path: '/Announcement',
                    component: resolve => require(['../../components/pages/Announcement.vue'], resolve),
                    meta: { title: '公告公知',requireAuth:true }
                    
                },
                {
                    path: '/CarOutinInfo',
                    component: resolve => require(['../../components/pages/CarOutinInfo.vue'], resolve),
                    meta: { title: '车辆出入信息',requireAuth:true }
                    
                },
                {
                    path: '/CarInfo',
                    component: resolve => require(['../../components/pages/CarInfo.vue'], resolve),
                    meta: { title: '车辆信息',requireAuth:true }
                    
                },
                {
                    path: '/OwnerInfo',
                    component: resolve => require(['../../components/pages/OwnerInfo.vue'], resolve),
                    meta: { title: '业主信息',requireAuth:true }
                    
                },
                {
                    path: '/PersonalInfo',
                    component: resolve => require(['../../components/pages/PersonalInfo.vue'], resolve),
                    meta: { title: '个人信息',requireAuth:true }
                    
                },
                {
                    path: '/resetPerson',
                    component: resolve => require(['../../components/pages/resetPerson.vue'], resolve),
                    meta: { title: '编辑个人信息',requireAuth:true }
                    
                },
                {
                    path: '/ResetPassword',
                    component: resolve => require(['../../components/pages/resetPassword.vue'], resolve),
                    meta: { title: '修改密码',requireAuth:true }
                    
                },
                {
                    path: '/Register',
                    component: resolve => require(['../../components/pages/register.vue'], resolve),
                    meta: { title: '注册',requireAuth:true }
                    
                },
             ]
            
         },
         {
            path: '/login',
            component: resolve => require(['../../components/pages/login.vue'], resolve)
        },
     ]
 })

 export default router;